﻿@using KXCXW.Web.CommonClass.Ext
@using System.Web.Mvc
@using Webdiyer.WebControls.Mvc
@using kxcxw.Data.Common
@model PagedList<kxcxw.Data.Entities.PublichInformation>
<div class="product_box">
    <div class="header line_top">
        <ul>
            @{
                string sortOrder = "";
                string orderfeild = "Date";
                string order = "Desc";
                if (Request.QueryString["sortOrder"] != null && Request.QueryString["sortOrder"].ToString() != "")
                {
                    sortOrder = Request.QueryString["sortOrder"].ToString();
                    string[] arr = sortOrder.Split('-');
                    orderfeild = arr[0];
                    if (arr.Length == 1)
                    {
                        order = "Asc";
                    }
                }
            }
            <li class="@(orderfeild == "Date" ? "current" : "")"><a title="默认按发布日期降序" href="@(CommonRepositories.UrlReplace(Request.Url.ToString(), "sortOrder", orderfeild == "Date" ? order == "Desc" ? "Date" : "Date-Desc" : "Date-Desc"))">
                默认</a><span class="@(orderfeild == "Date" ? (order == "Desc" ? "desc":"") : "desc")"></span></li>
            <li class="@(orderfeild == "Price" ? "current" : "")"><a href="@(CommonRepositories.UrlReplace(Request.Url.ToString(), "sortOrder", orderfeild == "Price" ? order == "Desc" ? "Price" : "Price-Desc" : "Price"))">
                价格</a><span class="@(orderfeild == "Price" && order == "Desc" ? "desc" : "")"></span></li>
            <li class="@(orderfeild == "Discount" ? "current" : "")"><a href="@(CommonRepositories.UrlReplace(Request.Url.ToString(), "sortOrder", orderfeild == "Discount" ? order == "Desc" ? "Discount" : "Discount-Desc" : "Discount"))">
                折扣</a><span class="@(orderfeild == "Discount" && order == "Desc" ? "desc" : "")"></span></li></ul>
    </div>
    <div class="content line_01">
        @Html.Partial("_InfoList", Model.ToList())
        <div class="pager">
            @Html.AjaxPager(
                    Model,
                    new PagerOptions()
                    {
                        PageIndexParameterName = "page",
                        FirstPageText = "首页",
                        LastPageText = "尾页",
                        NextPageText = "后一页",
                        PrevPageText = "前一页"
                    },
                    new AjaxOptions
                    {
                        UpdateTargetId = "dvOrders",

                    })
        </div>
    </div>
</div>
